/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.ssau.lib;

import javax.swing.JComboBox;

/**
 *
 * @author Дима
 */
public class AdvancedJComboBox extends JComboBox {
    public AdvancedJComboBox() {
        super();
    }

    public Object[] getAllItems() {
        int count = getItemCount();
        Object[] result = new Object[count];
        for(int i = 0; i < count; i++) {
            result[i] = getItemAt(i);
        }
        return result;
    }

    public void setItems(Object[] items) {
        this.removeAllItems();
        int count = items.length;
        for(int i = 0; i < count; i++) {
            addItem(items[i]);
        }
    }
}
